//
//  SplashView.m
//  WashForU
//
//  Created by 王俊 on 15/11/24.
//  Copyright © 2015年 王俊. All rights reserved.
//

#import "SplashView.h"

@implementation SplashView

+ (instancetype)initWithModelData:(SplashModel *)model
{
    SplashView *scrollView = [[SplashView alloc]init];
    scrollView.contentSize= CGSizeMake(SCREENWIDTH * model.imageNameSet.count,SCREENWIDTH);
    scrollView.pagingEnabled = true;
    scrollView.showsHorizontalScrollIndicator = false;
    scrollView.showsVerticalScrollIndicator =false;
    for (int i = 0; i < model.imageNameSet.count; i++)
    {
        UIImageView *img = [[UIImageView alloc]init];
        img.frame = CGRectMake(i * SCREENWIDTH, 0, SCREENWIDTH, SCREENHEIGHT);
        img.image = [UIImage imageNamed:model.imageNameSet[i]];
        [scrollView addSubview:img];
    }
    
    return scrollView;
    
}
@end
